<template>
    <div>
        <div>基础信息</div>
        <div class="pw100 flex_aj column">
            <r-list :ListRows="ListRows" :ListData="ListData"></r-list>
            <el-button v-if="ListData.state==2" class="mt20" type="success" @click="handle">处理</el-button>
          
        </div>

    </div>
</template>
<script>
export default {
    data() {
        return {
            ListRows: [
                [

                    {
                        label: '反馈单号',
                        prop: 'id',
                    },
                    {
                        label: '反馈用户',
                        prop: 'nickName',
                    },
                    {
                        label: '反馈内容',
                        prop: 'remark',
                    },
                    {
                        label: '状态',
                        prop: 'state',
                        formatter: e => e.state == 1 ? "已处理" : '未处理'
                    },
                    // {
                    //     label: '处理结果',
                    //     prop: 'handleResult',
                    // },
                    {
                        label: '反馈类型',
                        prop: 'type',
                    },
                    {
                        label: '手机号码',
                        prop: 'phone',
                    },
                    {
                        label: '反馈图片',
                        prop: 'picture',
                        type: 'img',
                        imglook: true
                    },
                    {
                        label: '处理人',
                        prop: 'updatedBy',
                    },
                    {
                        label: '处理时间',
                        prop: 'updatedTime',
                    },

                ]
            ],
            ListData: {
                id: 1,
                nickName: '张三丰',
                remark: '哎哎哎',
                state: '1',
                type: '',
                picture: []
            }
        };
    },
    components: {},
    computed: {},
    mounted() {
        this.init()
    },
    methods: {
        async init() {
            let res = await this.api.feedbackList({
                page: 1,
                limit: 10,
                id: this.$route.query.id
            })
            if (res) {
                this.ListData = res.data.list[0]
            }
        },
        async handle() {
            const that = this
            this.$prompt('处理备注', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                // inputPattern: '\S+',
            }).then(async ({ value }) => {
                let res = await that.api.feedbackupdate({
                    id: that.$route.query.id,
                    handleRemark: value
                })
                if (res) {
                    this.$message({
                        type: 'success',
                        message: '提交成功'
                    });
                }else{
                     this.$message({
                        type: 'error',
                        message: '提交失败'
                    });
                }
            }).catch(() => {

            });
        }
    }
};
</script>
<style scoped lang='scss'>
</style>